package com.harmonk.firstscene.db.repository

import com.harmonk.firstscene.db.dao.EventNoteDao
import com.harmonk.firstscene.db.entity.EventNote
import kotlinx.coroutines.flow.Flow

class EventNoteRepository(private val eventNoteDao: EventNoteDao) {
    
    suspend fun getTrafficNoteById(id: Long): EventNote? = eventNoteDao.getTrafficNoteById(id)
    
    fun getTrafficNotesByEventId(eventId: Long): Flow<List<EventNote>> = eventNoteDao.getTrafficNotesByEventId(eventId)
    
    suspend fun insertTrafficNote(eventNote: EventNote): Long = eventNoteDao.insertTrafficNote(eventNote)
    
    suspend fun updateTrafficNote(eventNote: EventNote) = eventNoteDao.updateTrafficNote(eventNote)
    
    suspend fun deleteTrafficNote(eventNote: EventNote) = eventNoteDao.deleteTrafficNote(eventNote)
    
    suspend fun deleteTrafficNotesByEventId(eventId: Long): Int = eventNoteDao.deleteTrafficNotesByEventId(eventId)
}